<?php
 Class ThreadsController extends MessagesAppController
 {
 	var $name = 'Threads';
 	var $components = array('Auth');
 	var $helpers = array('Form','Html');
	function view($threadId= null)
 	{
		if(!$threadId)
			$this->redirect($this->referer());
		$messages = $this->Thread->Message->find('all',array('conditions'=>array('Message.thread_id'=>$threadId),'order'=>'Message.created ASC'));
		$this->set('messages',$messages);
 	}
 	
 }
?>